{% extends "base.html" %}
{% load actions i18n features pipeline reviewtags %}

{% block extrahead %}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

{# NOTE: These are intentionally not localized. #}
<meta property="og:title" content="{{social_page_title}}" />
<meta property="og:description" content="{{social_page_description}}" />
<meta property="og:url" content="{{social_page_url}}" />
<meta name="twitter:title" content="{{social_page_title}}" />
<meta name="twitter:description" content="{{social_page_description}}" />
<meta name="twitter:url" content="{{social_page_url}}" />

{%  if social_page_image_url %}
<meta property="og:image" content="{{social_page_image_url}}" />
<meta name="twitter:image" content="{{social_page_image_url}}" />
{%  endif %}

{%  if review_request.repository %}
<meta name="twitter:label1" content="Repository" />
<meta name="twitter:data1" content="{{review_request.repository.name}}" />
{%  endif %}

{%  if review_request_details.branch %}
<meta name="twitter:label2" content="Branch" />
<meta name="twitter:data2" content="{{review_request_details.branch}}" />
{%  endif %}
{% endblock extrahead %}


{% block css %}
{{block.super}}
{%  stylesheet 'reviews' %}
{% endblock css %}


{% block scripts-post %}
{%  javascript 'reviews' %}
{% endblock %}


{% block page_class %}reviewable-page{% endblock %}


{% block js-page-view-type %}RB.ReviewablePageView{% endblock %}
{% block js-page-model-type %}RB.ReviewablePage{% endblock %}
{% block js-page-model-attrs %}{
    {% reviewable_page_model_data %}
}{% endblock js-page-model-attrs %}
{% block js-page-model-options %}{parse: true}{% endblock %}

{%  block unified_banner %}
{%   if_feature_enabled 'reviews.unified_banner' %}
<div id="unified-banner" class="rb-c-unified-banner">
 <div class="rb-c-unified-banner__review">
  <div class="rb-c-unified-banner__controls">
   <div class="rb-c-unified-banner__mode-selector"></div>
   <div class="rb-c-unified-banner__draft-actions">
    <input type="button" id="btn-review-request-discard"
           value="{% trans "Discard" %}">
   </div>
   <menu class="rb-c-unified-banner__review-actions rb-c-actions" role="menu">
{%    actions_html "unified-banner" %}
   </menu>
  </div>
  <div class="rb-c-unified-banner__changedesc">
   <p>
    <label for="field_change_description">
     {% trans "Describe your changes (optional):" %}
    </label>
   </p>
   <pre id="field_change_description" class="field field-text-area"
        data-field-id="field_change_description"></pre>
  </div>
 </div>
 <div class="rb-c-unified-banner__dock"></div>
</div>
{%  endif_feature_enabled %}
{{block.super}}
{%  endblock %}


{% block bodytag %}
{{block.super}}

{%  if_feature_disabled "reviews.unified_banner" %}
{%   block review_banner %}
<div id="review-banner"{% if not review %} hidden class="hidden"{% endif %}>
 <div class="banner">
  <h1>{% trans "You have a pending review." %}</h1>
  <input id="review-banner-edit" type="button" value="{% trans "Edit Review" %}" />

{% comment %}
 The Publish Review button markup here is a placeholder that will be fully
 replaced as the page loads. It's here to avoid a visual jump in the banner.
{% endcomment %}
  <div id="review-banner-publish-container" class="rb-c-menu-button">
   <div class="rb-c-button-group" role="group">
    <button class="rb-c-menu-button__primary rb-c-button" type="button">
     {% trans "Publish Review" %}
    </button>
    <button class="rb-c-menu-button__toggle rb-c-button" type="button">
     <span class="rb-icon rb-icon-dropdown-arrow"></span>
    </button>
   </div>
  </div>
  <input id="review-banner-discard" type="button" value="{% trans "Discard" %}" />
 </div>
</div>
{%   endblock %}
{%  endif_feature_disabled %}
{% endblock %}
